package com.cskaoyan.service;


import com.cskaoyan.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import javax.sql.DataSource;

/**
 * @author stone
 * @date 2022/09/30 11:39
 */
@Component
public class OrderServiceImpl implements OrderService {
    @Autowired
    UserDao userDao;

    @Autowired
    @Qualifier("datasource1")
    DataSource dataSource;

    @Resource(name = "dataSource2")
    DataSource dataSource3;

    @Autowired
    DataSource dataSource2;//@Autowired会按照成员变量的名称做匹配 equals

    /*@Autowired
    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }
    @Autowired
    public void setDataSource(@Qualifier("datasource1") DataSource dataSource) {
        this.dataSource = dataSource;
    }*/
}
